<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<% String path = request.getContextPath(); %>
<link href="<%=path %>/css/video-js.min.css" rel="stylesheet">
<link rel="stylesheet" href="<%=path %>/js/themes/insdep/easyui.css"/>
<link rel="stylesheet" href="<%=path %>/js/themes/insdep/easyui_animation.css"/>
<link rel="stylesheet" href="<%=path %>/js/themes/insdep/insdep_theme_default.css">
<link rel="stylesheet" href="<%=path %>/js/themes/insdep/icon.css">
<script type="text/javascript" src="<%=path %>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery.easyui-1.5.1.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/themes/insdep/jquery.insdep-extend.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="show"></div>
	<input type="hidden" id="brandOfficeId" value="${brandOfficeId}">
	<script type="text/javascript">
		var id = $("#brandOfficeId").val();
		var oldmasterid = -1;
		$(function(){
			$.ajax({
				url:"<%=path%>/userController/queryEmployeeByBrandOfficeId.do?brandOfficeId="+id,
				type:"post",
				data:"",
				dataType:"json",
				async:false,
				success:function(data){
					var radio = "";
					$.each(data,function(){
						radio += "<input type='radio' name='employeeId' value='"+this.employeeId+"'>"+this.employeeName+"<br/>";
					})
					$("#show").html(radio);
				},
				error:function(){
					alert("employee search fail");
				}
			})
			
			
			$.ajax({
				url:"<%=path%>/userController/queryMasterByBrandOfficeId.do?brandOfficeId="+id,
				type:"post",
				data:"",
				dataType:"json",
				async:false,
				success:function(data){
					oldmasterid = data.employeeId;
					var check = $("[name='employeeId']");
						$.each(check,function(){
						if(data.employeeId == $(this).val())
							{
								$(this).prop("checked",true);
							}
					})
				},
				error:function(){
					alert("master search fail");
				}
			})
		})
	</script>
</body>
</html>